﻿
namespace Taste
{
    /// <summary>
    /// Represents a transition from one state to another.
    /// </summary>
    public interface IStateTransition
    {
        /// <summary>
        /// The custom data given when leaving the current state.
        /// </summary>
        object UserData { get; }

        /// <summary>
        /// Rejects the transition to remain in the current state.
        /// </summary>
        void Reject();
    }

    /// <summary>
    /// Represents a transition from one state to another.
    /// </summary>
    public interface IStateTransition<TState> : IStateTransition
        where TState : struct
    {
        /// <summary>
        /// Accepts the transition and defines the next state to enter.
        /// </summary>
        /// <param name="nextStateName">The next state to enter.</param>
        /// <param name="userData">The custom data for the next state.</param>
        void AcceptAndEnter(TState nextStateName, object userData);
    }

}
